﻿@{
	// +++ disable Browser Cache for this page +++
	Response.CacheControl = "no-cache";
	Response.AddHeader("Pragma", "no-cache");
	Response.Expires = -1;
	// --- disable Browser Cache for this page ---
	string title = HttpUtility.HtmlEncode(Request.QueryString["title"]).Replace("\"", "\\\"");
	string scriptsUrl = String.IsNullOrEmpty(Request.QueryString["scriptsUrl"]) ? "" : Request.QueryString["scriptsUrl"];
	string paramVarName = Request.QueryString["paramVarName"];
	string viewType = Request.QueryString["viewType"];
}
<!DOCTYPE html>
<!-- (c) Copyright by Aras Corporation, 2004-2013. -->
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script>
			// setting title by document.write to disable IE security sideeffect, when page URL displayed instead of title
			document.write("<title>@title</title>");
		</script>
		<style type="text/css">
			@@import "../javascript/include.aspx?classes=arasClaro.css";
			@@import "../styles/controls.css";
			@@import "../styles/common.css";

			#top
			{
				height: 0px;
			}

			html, body
			{
				top:0px !important;
				overflow: hidden;
				width: 100%;
				height: 100%;
				margin: 0px;
				padding: 0px;
			}
		</style>
		<script type="text/javascript" id="ScriptSet1" src="../javascript/include.aspx?classes=ScriptSet1,TearOffMenuController,pageReturnBlocker"></script>
		<script>
			var aras = new Aras(@(paramVarName).aras);
			var viewType;
		</script>
		<script type="text/javascript" src="../javascript/include.aspx?classes=/dojo.js" data-dojo-config="baseUrl:'../javascript/dojo'"></script>
		<script type="text/javascript">
			require(["dojo/parser", "dojo/layout", "dojo/domReady!"], function (parser) {
				parser.parse();
			});
		</script>
		@RenderSection("header", false)
		<script type="text/javascript">
			window.addEventListener("DOMContentLoaded", function ()
			{
				if (typeof(window.tearOffMenuController) != "undefined")
					return;

				if (!viewType)
				{
					viewType = "@viewType";
				}

				window.tearOffMenuController = new TearOffMenuController({view: viewType, aras: aras });
				window.tearOffMenuController.initController();
				//compatibility code
				clientControlsFactory.createControl("Aras.Client.Frames.TearOffMenu", {tearOffMenuController: window.tearOffMenuController}, function(control) {
					var tearOffMenuControllerFrame = control;
				});
			});
		</script>
	</head>
	<body class="claro">
		<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="gutters:false, liveSplitters:false" style="width: 100%; height: 100%;" id="BorderContainer">
			<div id="top" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top', doLayout: false">
				<script type="text/javascript">
					function loadMainMenu(args, callback) {
						clientControlsFactory.createControl("Aras.Client.Controls.MainMenu", {id: "top_mainMenu", XML: args.xml}, function(control) {
							var mainMenu = control;
							mainMenu.placeAt("top", "first");
							mainMenu.startup();
							dojo.connect(mainMenu, "onSelect", window.tearOffMenuController, "onClickItem");
							dojo.connect(mainMenu, "onCheck", window.tearOffMenuController, "onCheckMenu");
							if (callback) {
								callback(mainMenu);
							}
						});
					}

					function loadToolbar(args, callback) {
						clientControlsFactory.createControl("Aras.Client.Controls.Toolbar", {id: "top_toolbar", ImageBase: "../cbin/"}, function(control) {
							var toolbar = control;
							this.tearOffMenuController.toolbar = toolbar;
							var topNode = document.getElementById("top");
							topNode.appendChild(toolbar.domNode);
							dojo.connect(toolbar, "onLoad", this.tearOffMenuController,"loadToolbar");
							dojo.connect(toolbar, "onClick", this.tearOffMenuController,"onClickItem");
							toolbar.startup();
							if (callback) {
								callback(toolbar);
							}
						});
					}
				</script>
			</div>
			<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center', splitter: true" id="center">
				@RenderSection("center", false)
			</div>
			<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom', layoutPriority: 1" id="bottom" style="height: 21px; margin-top: 2px;">
				<div data-dojo-type="Aras/Client/Controls/StatusBar" data-dojo-props="aras: top.aras, resourceUrl: top.aras.getI18NXMLResource('tabview_statusbar.xml', top.aras.getBaseURL())" id="bottom_statusBar">
					<script type="dojo/connect" data-dojo-event="startup">
						//compatibility code
						clientControlsFactory.createControl("Aras.Client.Frames.StatusBar", {aras: top.aras, statusbar: this}, function(control) {
							window.statusbar = control;
						});
					</script>
				</div>
			</div>
		</div>
	</body>
</html>
